﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// 麻醉开始结束图标
    /// </summary>
    public partial class MZKJCtrl : EventIcon
    {

        #region Variables


        #endregion

        #region Constructor

        public MZKJCtrl()
        {
            InitializeComponent();
        }


        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void MaZuiStart()
        {
            Line line1 = new Line()
            {
                X1 = 0,
                Y1 = 0,
                X2 = this.Width,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line1);
            Line line2 = new Line()
            {
                X1 = this.Width,
                Y1 = 0,
                X2 = 0,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line2);
        }

        private void MaZuiEnd()
        {
            Line line1 = new Line()
            {
                X1 = 0,
                Y1 = 0,
                X2 = this.Width,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line1);
            Line line2 = new Line()
            {
                X1 = this.Width,
                Y1 = 0,
                X2 = 0,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line2);
            Line line = new Line()
            {
                X1 = this.Width / 2,
                Y1 = 0,
                X2 = this.Width / 2,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line);

        }

        #endregion

        #region Public/Protected Methods

        public override void ResizeIcon()
        {
            if (Identify)
            {
                MaZuiStart();
            }
            else
            {
                MaZuiEnd();
            }
        }

        #endregion

        #region EventHandlers

        #endregion


    }
}
